/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bionic.entity;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Artem
 */
@Entity
@Table(name = "reqest_status")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "ReqestStatus.findAll", query = "SELECT r FROM ReqestStatus r"),
    @NamedQuery(name = "ReqestStatus.findById", query = "SELECT r FROM ReqestStatus r WHERE r.id = :id"),
    @NamedQuery(name = "ReqestStatus.findByName", query = "SELECT r FROM ReqestStatus r WHERE r.name = :name"),
    @NamedQuery(name = "ReqestStatus.findByStatusType", query = "SELECT r FROM ReqestStatus r WHERE r.statusType = :statusType")})
public class ReqestStatus implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Column(name = "name")
    private String name;
    @Column(name = "status_type")
    private String statusType;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "statusId")
    private Collection<Reqest> reqestCollection;

    public ReqestStatus() {
    }

    public ReqestStatus(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getStatusType() {
        return statusType;
    }

    public void setStatusType(String statusType) {
        this.statusType = statusType;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ReqestStatus)) {
            return false;
        }
        ReqestStatus other = (ReqestStatus) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ReqestStatus{" + "id=" + id + ", name=" + name + '}';
    }
  
}
